import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import Friends from '../views/Friends'
import Search from '../views/Search'
import Carts from '../views/Carts'
import NewsList from '../views/Home/news/NewsList.vue'
import NewsInfo from '../views/Home/news/NewsInfo.vue'
Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/home'
  },
 {
   path:'/home',
   component:Home
 },
 {
  path:'/carts',
  component:Carts
},
{
  path:'/friends',
  component:Friends
},
{
  path:'/search',
  component:Search
},
{
  path:'/home/newslist',
  component:NewsList
},
{
  props:true,
  path:'/home/newsinfo/:id',
  component:NewsInfo
}
]

const router = new VueRouter({
  routes
})

export default router
